API Documentation
Quaternion.h
1 // Quaternion.h
3 //
5 
6 namespace nkMaths
7 {
13  class Quaternion
14  {
15  public :
16 
17  // Attributes
18  float _x ;
19  float _y ;
20  float _z ;
21  float _w ;
22 
23  public :
24 
38  Quaternion (float x, float y, float z, float w) ;
45  Quaternion (const Vector& axis, float angle) ;
51  Quaternion (const Vector& eulerAngles) ;
57  Quaternion (const Matrix& mat) ;
63  Quaternion (const Quaternion& other) ;
64 
69 
77  Quaternion& setFromAxisAngle (const Vector& axis, float angle) ;
84  Quaternion& setFromEuler (const Vector& angles) ;
99 
100  // Transformations
108  Vector transform (const Vector& vector) const ;
116  Vector& apply (Vector& vector) const ;
117 
118  // Utilities
125  void fromString (const nkMemory::StringView& str) ;
126 
127  // Operators
140  Vector operator* (const Vector& other) const ;
147  Quaternion operator* (const Quaternion& other) const ;
153  void operator*= (const Quaternion& other) ;
160  bool operator== (const Quaternion& other) const ;
161  } ;
162 }
nkMaths::Quaternion::operator*=
void operator*=(const Quaternion &other)
nkMaths::Quaternion::_z
float _z
Z component of the quaternion.
Definition: Quaternion.h:20
nkMaths
Encompasses all API of component NilkinsMaths.
Definition: IntVector.h:7
nkMaths::Quaternion
A quaternion, symbolizing rotations as a 4D vector.
Definition: Quaternion.h:14
nkMaths::Quaternion::operator=
Quaternion & operator=(const Quaternion &other)
nkMaths::Quaternion::apply
Vector & apply(Vector &vector) const
nkMaths::Quaternion::Quaternion
Quaternion(const Vector &axis, float angle)
nkMaths::Quaternion::setFromEuler
Quaternion & setFromEuler(const Vector &angles)
nkMaths::Matrix
Represents a 4x4 float matrix.
Definition: Matrix.h:14
nkMaths::Quaternion::_y
float _y
Y component of the quaternion.
Definition: Quaternion.h:19
nkMaths::Quaternion::setFromAxisAngle
Quaternion & setFromAxisAngle(const Vector &axis, float angle)
nkMaths::Quaternion::Quaternion
Quaternion(const Vector &eulerAngles)
nkMaths::Quaternion::Quaternion
Quaternion(const Quaternion &other)
nkMaths::Quaternion::operator==
bool operator==(const Quaternion &other) const
nkMaths::Quaternion::setFromOrientationMatrix
Quaternion & setFromOrientationMatrix(const Matrix &mat)
nkMaths::Quaternion::setFromTransformationMatrix
Quaternion & setFromTransformationMatrix(const Matrix &mat)
nkMaths::Quaternion::transform
Vector transform(const Vector &vector) const
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkMaths::Quaternion::_x
float _x
X component of the quaternion.
Definition: Quaternion.h:18
nkMaths::Quaternion::_w
float _w
W component of the quaternion.
Definition: Quaternion.h:21
nkMaths::Quaternion::Quaternion
Quaternion(float x, float y, float z, float w)
nkMaths::Quaternion::fromString
void fromString(const nkMemory::StringView &str)
nkMaths::Quaternion::Quaternion
Quaternion(const Matrix &mat)
nkMaths::Quaternion::getAsEulerAngles
Vector getAsEulerAngles() const
nkMaths::Quaternion::operator*
Vector operator*(const Vector &other) const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkMaths::Quaternion::Quaternion
Quaternion()